﻿using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;

namespace TextAnalytics.Models
{
    [DebuggerDisplay("{Text}")]
    public class WordModel
    {
        public WordModel(string text)
        {
            Text = text;
            Occurrences = new List<WordPositionModel>();
        }
        public string Text { get; private set; }
        public List<WordPositionModel> Occurrences;
    }

    public class WordPositionModel
    {
        public ParagraphModel Paragraph { get; set; }
        public int SentenceIndexInParagraph { get; set; }
        public int WordIndexInSentence { get; set; }
    }

    [DebuggerDisplay("{Text}")]
    public class SentenceModel
    {
        public SentenceModel(string text)
        {
            Text = text;
            Words = new List<WordModel>();
        }
        public string Text { get; set; }
        public List<WordModel> Words { get; private set; }
    }

    [DebuggerDisplay("{Text}")]
    public class ParagraphModel
    {
        public ParagraphModel(string text)
        {
            Text = text;
            Sentences = new List<SentenceModel>();
        }
        public string Text { get; set; }
        public List<SentenceModel> Sentences { get; private set; }
    }

    public class TextSplitResultModel
    {
        public TextSplitResultModel()
        {
            Paragraphs = new ParagraphModel[0];
            Words = new SortedDictionary<string, WordModel>();
        }
        public ParagraphModel[] Paragraphs { get; set; }
        public SortedDictionary<string, WordModel> Words { get; set; }
        public int SentenceCount { get; set; }
        public int ParagraphCount { get; set; }
    }
}
